function control = parameter__control__create(parameter, context)

% CLIP - parameter__control__create

% Copyright (C) 2002-2007 Harold K. Figueroa (hkf1@cornell.edu)
% Copyright (C) 2005-2007 Matthew E. Robbins (mer34@cornell.edu)
%
% This file is part of XBAT.
% 
% XBAT is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
% 
% XBAT is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
% 
% You should have received a copy of the GNU General Public License
% along with XBAT; if not, write to the Free Software
% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

control = empty(control_create);
%{
control(end + 1) = control_create( ...
	'name', 't', ...
    'alias', 'Window (s)', ...
	'style', 'slider', ...
	'min', 0.0001, ...
	'max', 0.05, ...
	'slider_inc', [0.0001, 0.0002], ...
   	'space', 1, ...
	'value', parameter.t ...
);

control(end + 1) = control_create( ...
	'name', 'nf', ...
    'alias', '# of Frames', ...
	'style', 'slider', ...
	'type', 'integer', ...
	'min', 1, ... 
	'max', 30, ...
	'slider_inc', [1, 2], ...
	'space', 1, ...
	'value', parameter.nf ...
);
%}
control(end + 1) = control_create( ...
	'name', 'level', ...
	'style', 'slider', ...
	'type', 'integer', ...
	'min', 1, ... 
	'max', 10, ...
	'slider_inc', [1, 2], ...
	'space', 1, ...
	'value', parameter.level ...
);



control(end + 1) = control_create( ...
	'name', 'type1', ...
	'alias', 'Hard', ...
	'style', 'checkbox', ...
	'onload', 1, ...
	'space', 0.75, ...
	'value', parameter.type1 ...
);


control(end + 1) = control_create( ...
	'name', 'type2', ...
	'alias', 'Soft', ...
	'style', 'checkbox', ...
	'onload', 1, ...
	'space', 0.75, ...
	'value', parameter.type2 ...
);

control(end + 1) = control_create( ...
	'name', 'type3', ...
	'alias', 'MMSE', ...
	'style', 'checkbox', ...
	'onload', 1, ...
	'space', 0.75, ...
	'value', parameter.type3 ...
);

control(end+1) = control_create( ...
    'string', 'Silence Selection',...
    'type', 'header',...
    'style', 'separator' ...
);
%%{
control(end + 1) = control_create( ...
	'name', 'flag', ...
    'alias', 'Auto Detect Silence', ...
	'style', 'checkbox', ...
    'onload', 1,...
	'value', parameter.flag ...
);

control(end + 1) = control_create( ...
	'name', 'ratio', ...
    'alias', 'Silence Ratio', ...
	'style', 'slider', ...
	'min', 0, ...
	'max', 0.5, ...
	'slider_inc', [0.01, 0.05], ...
	'value', parameter.ratio ...
);
%}

control(end + 1) = control_create( ...
    'name', 'start_time',...
    'alias', 'Silence Start Time',...
    'style', 'edit',...
    'value', parameter.start_time ...
);

control(end + 1) = control_create( ...
    'name', 'end_time',...
    'alias', 'Silence End Time',...
    'style', 'edit',...
    'value', parameter.end_time ...
);

control(end+1) = control_create( ...
    'name', 'identify',...
    'alias', 'Identify selected region', ...
    'style', 'buttongroup' ...
);

control(end+1) = control_create( ...
    'string', 'Save Output',...
    'type', 'header',...
    'style', 'separator' ...
);

control(end + 1) = control_create( ...
	'name', 'save', ...
    'alias', 'Save the filtered output Sound', ...
    'tooltip', 'Do not check this box until after running the filter.',...
	'style', 'checkbox', ...
	'value', parameter.save ...
);
